package com.to.aboomy.bannersample.pagetransformer;

import com.to.aboomy.banner.BannerViewPager;
import ohos.agp.components.Component;

/**
 * @author xujianhong
 * @since 2021-08-05
 */
public class CubeInTransformer implements BannerViewPager.PageTransformer {
    @Override
    public void transformerPage(BannerViewPager.PageType pageType, Component page, float offset, float offsetPixels) {

        switch (pageType) {
            case PREVIOUS:
//                page.setScaleX(1F);
//                page.setScaleY(1F);
//                page.setRotation(0f);
                break;
            case CURRENT:
//                if (offsetPixels > 0) {
//                    page.setPivotY(page.getWidth()/2);
//                }else{
//                    page.setPivotX(page.getWidth());
//                    page.setPivotY(0f);
//                }
//                page.setRotation(-20f*offset);
                break;
            case NEXT:
                break;
            case OTHER:
//                page.setScaleX(1F);
//                page.setScaleY(1F);
//                page.setRotation(0f);
                break;
        }
    }
}
